﻿Public Class DonViTinhDAO
    Public Shared Sub insert(ByVal DonViTinh As DonViTinhDTO)
        Dim strSQL As String
        strSQL = "insert into DONVITINH(MADONVITINH,TENDONVITINH) Values('" & DonViTinh.MaDonViTinh & "','" & DonViTinh.TenDonViTinh & "')"

        SQLProvider.ExecNoneQuery(strSQL)
    End Sub
    Public Shared Function selectALL() As DataTable
        Dim strSQL As String
        strSQL = "select * from DONVITINH"

        Dim dt As DataTable
        dt = SQLProvider.ExecQuery(strSQL)
        Return dt
    End Function
    Public Shared Sub delete(ByVal MaDonViTinh As String)
        Dim strSQL As String
        strSQL = "delete from DONVITINH where MADONVITINH = '" & MaDonViTinh & "'"
        SQLProvider.ExecNoneQuery(strSQL)
    End Sub
    Public Shared Sub Update(ByVal DonViTinh As DonViTinhDTO)
        Dim strSQL As String = "Update DONVITINH set TENDONVITINH = '" & DonViTinh.TenDonViTinh & "' where MADONVITINH = '" & DonViTinh.MaDonViTinh & "'"
        SQLProvider.ExecNoneQuery(strSQL)
    End Sub
End Class
